<%--
  Created by IntelliJ IDEA.
  User: yangbushudemao
  Date: 2021/5/11
  Time: 17:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form class="form-horizontal" role="form" id="addRoleForm">
    <div class="form-group">
        <label for="roleName" class="col-sm-5 control-label">角色名称:</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" id="roleName" name="rname" placeholder="请输角色名字">
        </div>
    </div>
    <div class="form-group">
        <label for="menu" class="col-sm-5 control-label">权限:</label>
        <div class="col-sm-5">
            <div class="zTreeDemoBackground left" id="menu">
                <ul id="treeDemo" class="ztree"></ul>
            </div>
        </div>
    </div>
</form>
</body>
</html>
<script>
    var setting = {
        check: { // 显示复选框
            enable: true,
            autoCheckTrigger: true
        },
        async: {// 异步请求菜单数据
            enable: true,
            dataType: "json",
            url: "<%=path%>/menuController/getMenuZtree",

        },
    };
    $(document).ready(function(){
        $.fn.zTree.init($("#treeDemo"), setting);
    });
</script>